<template>
    <div class="exam-wrap">
        <div class="main clearfix">
            <p class="title">{{details.title}}</p>
            <div class="infobox clearfix">
                <p class="author fl">{{details.nickname}}</p>
                <p class="time fr">{{details.showPubTime}}</p>
            </div>
            <div class="content">
                <p>{{details.content}}</p>
            </div>
        </div>

    </div>
</template>

<style>
    .main{
        padding: 0px 15px;
    }
    .infobox p{
        line-height: 1.5em;
    }
    .title{
        font-size: 16px;
        padding: 10px 15px 15px;
        text-align: center;
    }
    .time{
        font-size: 12px;
    }
    .content{
        text-indent: 2em;
        padding: 20px 0px;
        line-height: 1.5em;
        font-size: 14px;
    }
    
</style>

<script>
    import conf from '../config/userconf.js'
    export default {
        name:"news",
        data() {
            return {
                details: {},
            };
        },
        methods: {
            init(data=Object()){
                console.log('------------id-------------',this.$route.query.id);
                data.id = this.$route.query.id;
                conf.exams.noticedetail(data,(state,res)=>{
                    if (state == 'success'&&res.data.status == 1){
                        console.log(res.data);

                        this.details = res.data.other.info;
                        
                    }else if(state == 'success'&&res.data.status != 1){
                        this.$toast(res.data.message);
                    }
                })
            },
            
        },
        mounted (){
            this.init();
            document.title = "消息通知";
        },
    }
</script>